package com.luck.model.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.text.SimpleDateFormat;
import java.util.Date;

@ApiModel("model-用户实体")
public class Users{
    @ApiModelProperty(value = "用户id")
    private Integer userId;
    @ApiModelProperty("名字")
    private String name;
    @ApiModelProperty("邮箱")
    private String email;
    @ApiModelProperty("手机号")
    private String phone;
    @ApiModelProperty("qq")
    private String qq;
    @ApiModelProperty("密码")
    private String pwd;
    @ApiModelProperty("密码token")
    private String pwdToken;
    @ApiModelProperty("token")
    private String token;

    private Date createTime;
    @ApiModelProperty("状态")
    private Integer status;
    @ApiModelProperty("图片")
    private String img;
    @ApiModelProperty("性别")
    private Integer sex;
    @ApiModelProperty("生日")
    private Date birthday;
    @ApiModelProperty("是否删除")
    private Integer isDeleted;

    public Users(Integer userId, String name, String email, String phone, String qq, String pwd, String pwdToken, Date createTime, Integer status, String img, Integer sex, Date birthday, Integer isDeleted) {
        this.userId = userId;
        this.name = name;
        this.email = email;
        this.phone = phone;
        this.qq = qq;
        this.pwd = pwd;
        this.pwdToken = pwdToken;
        this.createTime = createTime;
        this.status = status;
        this.img = img;
        this.sex = sex;
        this.birthday = birthday;
        this.isDeleted = isDeleted;
    }

    public Users() {
        super();
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name == null ? null : name.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone == null ? null : phone.trim();
    }

    public String getQq() {
        return qq;
    }

    public void setQq(String qq) {
        this.qq = qq == null ? null : qq.trim();
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd == null ? null : pwd.trim();
    }

    public String getPwdToken() {
        return pwdToken;
    }

    public void setPwdToken(String pwdToken) {
        this.pwdToken = pwdToken == null ? null : pwdToken.trim();
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getStatus() {
        return status;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img == null ? null : img.trim();
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        Date birthdayDate = new Date();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        try {
            birthdayDate = sdf.parse(birthday);
        } catch (Exception e) {
            e.printStackTrace();
        }
        this.birthday = birthdayDate;
    }
    public void setBirthdayDate(Date birthday) {
        this.birthday = birthday;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    @Override
    public String toString() {
        return "Users{" +
                "userId=" + userId +
                ", name='" + name + '\'' +
                ", email='" + email + '\'' +
                ", phone='" + phone + '\'' +
                ", qq='" + qq + '\'' +
                ", pwd='" + pwd + '\'' +
                ", pwdToken='" + pwdToken + '\'' +
                ", createTime=" + createTime +
                ", status=" + status +
                ", img='" + img + '\'' +
                ", sex=" + sex +
                ", birthday=" + birthday +
                ", isDeleted=" + isDeleted +
                '}';
    }
}